{
	template:`
	<a-page-header title="编辑" sub-title="接口信息">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="10">
						<a-form-item label="类型" class="index-form-item">
							<a-radio-group :options="dictOptions('api.model.ApiAuthInter!type')" v-model:value="model.type" />
						</a-form-item>
					</a-col>
					<a-col :span="14">
						<a-form-item label="名称" class="index-form-item">
                            <a-tooltip title="只能输入小写字母数字和下划线">
                                <a-input v-model:value="model.name" placeholder="请输入名称"/>
							</a-tooltip>
						</a-form-item>
					</a-col>
					<a-col :span="24">
						<a-form-item label="描述" class="index-form-item">
							<a-input v-model:value="model.description" placeholder="请输入描述"/>
						</a-form-item>
					</a-col>
					<a-col :span="10">
						<a-form-item label="接口模型" class="index-form-item">
							<a-select :options="dictOptions('api.model.ApiTable')" v-model:value="model.modelTable.oid" @change="loadSubTablesOptions()" placeholder="请选择接口模型" show-search :filter-option="selectFilter" />
						</a-form-item>
					</a-col>
					<a-col :span="14" v-if="model.type!='A'">
						<a-form-item label="扩展属性" class="index-form-item">
							<a-select :options="subTablesOptions" v-model:value="model.subTables" placeholder="请选择扩展属性" mode="multiple" show-search :filter-option="selectFilter" />
						</a-form-item>
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
		    model:{admin:{},org:{}},
            subTablesOptions:[],
		};
	},
	mounted(){
	    this.model=this.param.model;
	    let subTables=this.model.subTables;
	    this.loadSubTablesOptions(()=>{
	        this.model.subTables=subTables;
	    });
	},
	methods:{
		save:function(){
			this.requestData('action/api/apiAuthInter/doSave',
				{model:this.model},
				data=>{
					if(data.code==0){
						this.$message.success(data.msg);
						this.model=data.model;
						this.back(true);
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
		loadSubTablesOptions:function(fn){
			this.requestData('action/api/apiColumn/getModelColumnOption',
				{tableOid:this.model.modelTable.oid},
				data=>{
					if(data.code==0){
					    this.subTablesOptions=data.options;
                        this.model.subTables=[];
					}else{
						this.$message.error(data.msg);
					}
					if(fn) fn();
				}
			);
		}
	}
}